import React, { PureComponent } from 'react'
import { withRouter } from 'react-router-dom'
 class NiceItem extends PureComponent {
  goDes=(el)=>{
    // console.log(el);
    this.props.history.push(`/moviedes/${el.movieId}/${el.name}`)
    this.props.recordDes(el)
  }

  render() {
    let { nicelist } = this.props
    return (
      <>

        <ul>
          {
            nicelist.map(el => {
              return (
                <li key={el.movieId} onClick={()=>this.goDes(el)}>
                  <div className="tu">
                    <img src={el.poster} alt="" />
                    <p className="mzi2">{el.score}评分</p>
                  </div>
                  <p className="mzi">{el.name}</p>
                </li>
              )
            })
          }
        </ul>
      </>
    )
  }
}
export default withRouter(NiceItem)